# -- get header files for creating "proper" XCode projects ---------------------

file(GLOB_RECURSE CAF_NET_HEADERS "caf/*.hpp")

# -- add targets ---------------------------------------------------------------

caf_add_component(
  net
  DEPENDENCIES
  PUBLIC
    $<$<CXX_COMPILER_ID:MSVC>:ws2_32>
    CAF::core
    OpenSSL::Crypto
    OpenSSL::SSL
  PRIVATE
    CAF::internal
    CAF::core
  ENUM_TYPES
    net.lp.size_field_type
    net.http.method
    net.http.status
    net.octet_stream.errc
    net.ssl.dtls
    net.ssl.errc
    net.ssl.format
    net.ssl.tls
    net.web_socket.status
  HEADERS
    ${CAF_NET_HEADERS}
  SOURCES
    caf/detail/connection_acceptor.cpp
    caf/detail/flow_bridge_initializer.cpp
    caf/detail/rfc6455.cpp
    caf/detail/rfc6455.test.cpp
    caf/detail/ws_conn_acceptor.cpp
    caf/internal/accept_handler.cpp
    caf/internal/lp_flow_bridge.cpp
    caf/internal/net_config.cpp
    caf/internal/octet_stream_flow_bridge.cpp
    caf/internal/ws_flow_bridge.cpp
    caf/net/abstract_actor_shell.cpp
    caf/net/accept_socket.test.cpp
    caf/net/actor_shell.cpp
    caf/net/actor_shell.test.cpp
    caf/net/datagram_socket.cpp
    caf/net/datagram_socket.test.cpp
    caf/net/generic_lower_layer.cpp
    caf/net/generic_upper_layer.cpp
    caf/net/http/async_client.cpp
    caf/net/http/async_client.test.cpp
    caf/net/http/client.cpp
    caf/net/http/client.test.cpp
    caf/net/http/header.cpp
    caf/net/http/header.test.cpp
    caf/net/http/lower_layer.cpp
    caf/net/http/method.cpp
    caf/net/http/multipart_reader.cpp
    caf/net/http/multipart_reader.test.cpp
    caf/net/http/multipart_writer.cpp
    caf/net/http/multipart_writer.test.cpp
    caf/net/http/request.cpp
    caf/net/http/request_header.cpp
    caf/net/http/request_header.test.cpp
    caf/net/http/responder.cpp
    caf/net/http/response.cpp
    caf/net/http/response_header.cpp
    caf/net/http/response_header.test.cpp
    caf/net/http/route.cpp
    caf/net/http/router.cpp
    caf/net/http/router.test.cpp
    caf/net/http/server.cpp
    caf/net/http/server.test.cpp
    caf/net/http/status.cpp
    caf/net/http/upper_layer.cpp
    caf/net/http/v1.cpp
    caf/net/http/with.cpp
    caf/net/ip.cpp
    caf/net/ip.test.cpp
    caf/net/lp/framing.cpp
    caf/net/lp/framing.test.cpp
    caf/net/lp/lower_layer.cpp
    caf/net/lp/upper_layer.cpp
    caf/net/lp/with.cpp
    caf/net/middleman.cpp
    caf/net/multiplexer.cpp
    caf/net/multiplexer.test.cpp
    caf/net/network_socket.cpp
    caf/net/network_socket.test.cpp
    caf/net/octet_stream/lower_layer.cpp
    caf/net/octet_stream/policy.cpp
    caf/net/octet_stream/transport.cpp
    caf/net/octet_stream/transport.test.cpp
    caf/net/octet_stream/upper_layer.cpp
    caf/net/octet_stream/with.cpp
    caf/net/octet_stream/with.test.cpp
    caf/net/pipe_socket.cpp
    caf/net/pipe_socket.test.cpp
    caf/net/prometheus.cpp
    caf/net/socket.cpp
    caf/net/socket.test.cpp
    caf/net/socket_event_layer.cpp
    caf/net/socket_guard.test.cpp
    caf/net/socket_manager.cpp
    caf/net/ssl/connection.cpp
    caf/net/ssl/context.cpp
    caf/net/ssl/context.test.cpp
    caf/net/ssl/dtls.cpp
    caf/net/ssl/errc.cpp
    caf/net/ssl/format.cpp
    caf/net/ssl/password.cpp
    caf/net/ssl/startup.cpp
    caf/net/ssl/tcp_acceptor.cpp
    caf/net/ssl/tls.cpp
    caf/net/ssl/transport.cpp
    caf/net/ssl/verify.cpp
    caf/net/stream_socket.cpp
    caf/net/stream_socket.test.cpp
    caf/net/tcp_accept_socket.cpp
    caf/net/tcp_accept_socket.test.cpp
    caf/net/tcp_stream_socket.cpp
    caf/net/tcp_stream_socket.test.cpp
    caf/net/this_host.cpp
    caf/net/typed_actor_shell.test.cpp
    caf/net/udp_datagram_socket.cpp
    caf/net/udp_datagram_socket.test.cpp
    caf/net/web_socket/client.cpp
    caf/net/web_socket/frame.cpp
    caf/net/web_socket/frame.test.cpp
    caf/net/web_socket/framing.cpp
    caf/net/web_socket/handshake.cpp
    caf/net/web_socket/handshake.test.cpp
    caf/net/web_socket/lower_layer.cpp
    caf/net/web_socket/server.cpp
    caf/net/web_socket/switch_protocol.cpp
    caf/net/web_socket/upper_layer.cpp
    caf/net/web_socket/with.cpp)

caf_add_test_executable(
  caf-net-autobahn-driver
  SOURCES
    tests/drivers/autobahn.cpp
  DEPENDENCIES
    CAF::net)
